package com.letv.core.network.volley.listener;

import com.letv.core.network.volley.VolleyRequest;
import com.letv.core.network.volley.VolleyResponse.CacheResponseState;
import com.letv.core.network.volley.VolleyResponse.NetworkResponseState;
import com.letv.core.network.volley.VolleyResponse.ResponseSupplier;

/**
 * 将请求响应进行解析并交付给请求发起者的接口
 * 
 * @author zhuqiao
 *
 */
public interface ResponseDelivery {

    /**
     * 发送成功响应
     * 
     * @param request
     * @param responseSupplier
     */
    void postResponse(VolleyRequest<?> request, ResponseSupplier responseSupplier);

    /**
     * 发送网络失败响应
     * 
     * @param request
     * @param networkState
     */
    void postError(VolleyRequest<?> request, NetworkResponseState networkState);

    /**
     * 发送缓存失败响应
     * 
     * @param request
     * @param cacheState
     */
    void postError(VolleyRequest<?> request, CacheResponseState cacheState);
}
